#!/usr/bin/env python
# -*- coding: utf-8 -*-

# psutil - vmstat 
# user% sys% iowait
import psutil
# print psutil.cpu_times(percpu=False)
# cputimes(user=963.63, nice=0.0, system=11224.4, idle=1250637.14,...)

print "user=%.1f"       %(psutil.cpu_times().user)
print "sys=%.1f"        %(psutil.cpu_times().system)
print "idle=%.2f"       %(psutil.cpu_times().idle)

print "user=%.1f"       %(psutil.cpu_times_percent().user)
print "sys=%.1f"        %(psutil.cpu_times_percent().system)
print "idle=%.2f"       %(psutil.cpu_times_percent().idle)

# 以下在 win10 bash 上执行有问题，在其他地方没问题
print "cpu_count=%s"    %(psutil.cpu_count()) 


